package com.astrob;

public final class NavFrameSDK {
	static {
		System.loadLibrary("gbkconvert");
		/*
		 * System.loadLibrary("clientbase2"); System.loadLibrary("rts");
		 * System.loadLibrary("rscsdk");
		 */
		System.loadLibrary("NavFrame");
	}

	public static NavFrameSDK getInstance() {
		return instance;
	}

	private static NavFrameSDK instance = new NavFrameSDK();

	public class CLonLat {
		public double lon;
		public double lat;
	}

	public CLonLat NewCLonLat() {
		return new CLonLat();
	}

	public class CllDegreePreMeter {
		public double londegree;
		public double latdegree;
	}

	public class CLenPreLonlat {
		public double len_pre_lon;
		public double len_pre_lat;
	}

	public class CPoint {
		public long x;
		public long y;
	}

	public class NavStart {
		public NavStart() {
			pos = new CLonLat();
			name = "";
			eid = 0;
		}

		public CLonLat pos;
		public double dir; // accord to GPS direction
		public int eid;
		public int pname; // 锟斤拷应const wchar_t*
		public String name; // 锟斤拷应wchar_t [256]
	}

	public class NavDest {
		public NavDest() {
			pos = new CLonLat();
			name = "";
		}

		public CLonLat pos;
		public int eid;
		public int pname; // 锟斤拷应const wchar_t*
		public String name; // 锟斤拷应wchar_t [256]
	}

	public class RouteErrorInfo {
		public boolean isSuccess;
		public int IndexOfErorPath;
		public int errorCode;
	}

	public class RouteOption {
		public boolean bFastest; // 最快或最短
		public boolean bHighway; // 是否走高速
		public boolean bTurnLimit; // 是否考虑转弯限制
		public boolean bFerry; // 是否走轮渡
		public boolean bToll; // 是否走收费站
		public boolean bMetro; // 0: 不走地铁 1：走地铁
	}

	public class PathLengthInfo {
		public double total;
		public double totalHW;
		public double totalToll;
		public double totalFerry;
	}

	public class NavPosition {
		public NavPosition() {
			pos = new CLonLat();
		}

		public CLonLat pos; // position
		public double vel; // velocity
		public double dir; // direction, accord to GPS direction.
		public int signal; // intensity of signal.0~100
	}

	public class CamInfo {
		public CamInfo() {
			speedLimit = 0;
			distance = 0;
			type = 0;
		}

		public int speedLimit;
		public int distance;
		public int type;
	}

	public class LaneInfo {
		public LaneInfo() {
			lanes = new int[16];
			adviceIndex = 0;
		}

		public int[] lanes;
		public int adviceIndex;
	}

	public class SingleSignPost {
		public SingleSignPost() {
			signName = "";
			signNameReal = "";
			roadNum = "";
			distance = 0;
			isOut = false;
			turnType = 0;
			traffic = 'Z';
			eventType = 0;
			lon = 0;
			lat = 0;
			eid = new int[20];
			dirType = 0;
			turnIndex = -1;
		}

		public String signName;
		public String signNameReal;
		public String roadNum;
		public int distance;
		public boolean isOut;
		public int turnType;
		public byte traffic;
		public byte eventType;
		public double lon;
		public double lat;
		public int[] eid;
		public int dirType;
		public int turnIndex;
	}

	public class SignPostInfo {
		public SignPostInfo() {
			signpost1 = new SingleSignPost();
			signpost2 = new SingleSignPost();
			signpost3 = new SingleSignPost();
			signpost4 = new SingleSignPost();
		}

		public SingleSignPost signpost1;
		public SingleSignPost signpost2;
		public SingleSignPost signpost3;
		public SingleSignPost signpost4;
	}

	public class JuncView {
		public JuncView() {
			distance = 0;
			bmpName = "";
		}

		public int distance;
		public int type;
		// bmp锟斤拷疲锟斤拷锟斤拷锟铰凤拷锟斤拷秃锟阶?
		public String bmpName;
	}

	public class GuideInfo {
		public GuideInfo() {
			remainDistance = 0;
			distanceToTurn = 0;
			speedCamera = new CamInfo();
			roadSpeedLimit = 0;
			juncView = new JuncView();
			laneInfo = new LaneInfo();
			signpostInfo = new SignPostInfo();
			fromRoadName = "";
			fromRoadType = 0;
			chooseHW = 0;
			turnIndex = -1;
		}

		public double remainDistance;
		public double distanceToTurn;
		public CamInfo speedCamera;
		public int roadSpeedLimit;
		public JuncView juncView;
		public LaneInfo laneInfo;
		public SignPostInfo signpostInfo; // 3
		public String fromRoadName;
		public int fromRoadType;
		public int chooseHW;
		public int turnIndex;
	}

	public enum CategoryChangeType {
		// priority increase from top to bottom
		TURN_NULL(0), // 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
		TURN_ENTERCIRCLE(1), // 锟斤拷锟斤拷圆锟斤拷
		TURN_EXITCIRCLE(2), // 锟诫开圆锟斤拷
		TURN_ENTERFERRY(3), // 锟斤拷锟斤拷锟街讹拷
		TURN_EXITFERRY(4), // 锟诫开锟街讹拷
		TURN_ENTERTUNNEL(5), // 锟斤拷锟斤拷锟斤拷锟?
		TURN_ENTERSERVICES(6), // 锟斤拷锟斤拷锟斤拷锟斤拷锟?
		TURN_EXITSERVICES(7), // 锟诫开锟斤拷锟斤拷锟斤拷锟斤拷时未锟斤拷
		TURN_TOLL(8), // 锟秸凤拷站
		TURN_ENTERRAMP(9), // 锟斤拷锟窖碉拷,没锟叫筹拷锟窖碉拷锟斤拷锟斤拷
		TURN_ENTERHWY(10), // 锟斤拷锟斤拷锟斤拷锟?
		TURN_EXITHWY(11), // 锟诫开锟斤拷锟斤拷
		TURN_AUX2MAIN(12), // 锟接革拷路锟斤拷锟斤拷锟斤拷路
		TURN_MAIN2AUX(13), // 锟斤拷锟斤拷路锟斤拷锟诫辅路
		TURN_ENTERLEFTTURNLANES(14), // 锟斤拷转专锟矫碉拷
		TURN_ENTERRIGHTTURNLANES(15), // 锟斤拷转专锟矫碉拷
		TURN_ENTERUTURN(16);

		private int value;

		private CategoryChangeType(int value) {
			this.value = value;
		}

		public static CategoryChangeType getCategoryChangeType(int value) {
			switch (value) {
			case 0:
				return TURN_NULL;
			case 1:
				return TURN_ENTERCIRCLE;
			case 2:
				return TURN_EXITCIRCLE;
			case 3:
				return TURN_ENTERFERRY;
			case 4:
				return TURN_EXITFERRY;
			case 5:
				return TURN_ENTERTUNNEL;
			case 6:
				return TURN_ENTERSERVICES;
			case 7:
				return TURN_EXITSERVICES;
			case 8:
				return TURN_TOLL;
			case 9:
				return TURN_ENTERRAMP;
			case 10:
				return TURN_ENTERHWY;
			case 11:
				return TURN_EXITHWY;
			case 12:
				return TURN_AUX2MAIN;
			case 13:
				return TURN_MAIN2AUX;
			case 14:
				return TURN_ENTERLEFTTURNLANES;
			case 15:
				return TURN_ENTERRIGHTTURNLANES;
			case 16:
				return TURN_ENTERUTURN;
			default:
				return null;
			}
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}
	}

	public static CategoryChangeType GetCategoryChangeType(int value) {
		return CategoryChangeType.getCategoryChangeType(value);
	}

	public enum TurnDirection {
		TURN_RESERVE(0), // 缺省
		TURN_END(1), // 目锟侥碉拷
		TURN_STRAIGHT_SAME(2), // 锟斤拷锟斤拷直锟斤拷
		TURN_LEFTFRONT(3), // 锟斤拷前锟斤拷锟斤拷图锟斤拷锟接?锟斤拷锟斤拷
		TURN_LEFT(4), // 锟斤拷转
		TURN_LEFTBEAR(5), // 锟斤拷蠓剑锟酵硷拷锟斤拷应 锟斤拷转锟斤拷
		TURN_RIGHTBEAR(6), // 锟揭猴拷
		TURN_RIGHT(7), // 锟斤拷转
		TURN_RIGHTFRONT(8), // 锟斤拷前锟斤拷
		TURN_ONLYLEFT(9), // 锟斤拷锟斤拷45锟斤拷之锟斤拷锟斤拷1锟斤拷2锟街?锟斤拷图锟斤拷锟接︼拷锟斤拷锟?
		TURN_ONLYRIGHT(10), // 锟斤拷锟揭ｏ拷45锟斤拷之锟斤拷锟斤拷1锟斤拷2锟街?锟斤拷图锟斤拷锟接︼拷锟斤拷锟?
		TURN_UTURN(11), // 锟斤拷头
		TURN_3FORK(12), // 锟斤拷植?锟斤拷锟斤拷锟斤拷锟斤拷驶
		TURN_3FORKONLYLEFT(13), // 锟斤拷植?锟斤拷锟斤拷锟斤拷驶
		TURN_3FORKONLYRIGHT(14), // 锟斤拷植?锟斤拷锟斤拷锟斤拷驶
		TURN_UNDEFINE(15);

		private int value;

		private TurnDirection(int value) {
			this.value = value;
		}

		public static TurnDirection getTurnDirection(int value) {
			switch (value) {
			case 0:
				return TURN_RESERVE;
			case 1:
				return TURN_END;
			case 2:
				return TURN_STRAIGHT_SAME;
			case 3:
				return TURN_LEFTFRONT;
			case 4:
				return TURN_LEFT;
			case 5:
				return TURN_LEFTBEAR;
			case 6:
				return TURN_RIGHTBEAR;
			case 7:
				return TURN_RIGHT;
			case 8:
				return TURN_RIGHTFRONT;
			case 9:
				return TURN_ONLYLEFT;
			case 10:
				return TURN_ONLYRIGHT;
			case 11:
				return TURN_UTURN;
			case 12:
				return TURN_3FORK;
			case 13:
				return TURN_3FORKONLYLEFT;
			case 14:
				return TURN_3FORKONLYRIGHT;
			case 15:
				return TURN_UNDEFINE;
			default:
				return null;
			}
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}
	}

	public static TurnDirection GetTurnDirection(int value) {
		return TurnDirection.getTurnDirection(value);
	}

	public class TurnInfo {
		public TurnInfo() {
			toRoadName = "";
			categoryChange = CategoryChangeType.TURN_NULL;
			dirType = TurnDirection.TURN_RESERVE;
			nCrossCount = 0;
			nCircleExit = 0;
		}

		public CategoryChangeType categoryChange; // ATTRIBUTE_CHANGE_VALUES
		public TurnDirection dirType; // TURN_DIRECTION
		public int nCrossCount;
		public int nCircleExit;
		public String toRoadName;
	}

	public class NavInfo {
		public NavInfo() {
			guidInfo = new GuideInfo();
			turnInfo = new TurnInfo();
			nextGuidInfo = new GuideInfo();
			nextTurnInfo = new TurnInfo();
			sentence = "";
		}

		public GuideInfo guidInfo;
		public TurnInfo turnInfo;
		public GuideInfo nextGuidInfo;
		public TurnInfo nextTurnInfo;
		public String sentence; // wchar_t 256
	}

	public enum SDCurPosStates {
		SDCURPOSSTATE_NONE(0), SDCURPOSSTATE_ARRIVED_DEST(1), SDCURPOSSTATE_DEVIATE(
				2), SDCURPOSSTATE_ARRIVED_MIDDLE_DEST(3);
		private int value;

		private SDCurPosStates(int value) {
			this.value = value;
		}

		public static SDCurPosStates getSDCurPosStates(int value) {
			switch (value) {
			case 0:
				return SDCURPOSSTATE_NONE;
			case 1:
				return SDCURPOSSTATE_ARRIVED_DEST;
			case 2:
				return SDCURPOSSTATE_DEVIATE;
			case 3:
				return SDCURPOSSTATE_ARRIVED_MIDDLE_DEST;
			default:
				return null;
			}
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}
	}

	public static SDCurPosStates GetSDCurPosStates(int value) {
		return SDCurPosStates.getSDCurPosStates(value);
	}

	// POI锟斤拷询锟斤拷锟?
	public class POIDescription {
		public POIDescription() {
			position = new CLonLat();
			pcode = new byte[12];
			name = "";
			owner = "";
			tel = "";
			address = "";
		}

		public String name; // 256
		public String owner; // 锟斤拷图锟斤拷锟斤拷锟斤拷锟斤拷锟?64
		public CLonLat position;
		public String tel; // 32
		public String address; // 256
		public int roadID;
		public byte[] pcode; // 12
		public int rank;
	}

	// 锟斤拷路锟斤拷询锟斤拷锟?
	public class RoadDescription {
		public RoadDescription() {
			position = new CLonLat();
			name = "";
			owner = "";
		}

		public int roadID;
		public String name; // 256
		public String owner; // 64
		public double distance; // 锟斤拷锟斤拷锟窖憋拷锟铰凤拷锟斤拷锟斤拷锟斤拷叹锟斤拷锟?
		public CLonLat position;
	}

	// Ada锟斤拷平锟斤拷
	public class AreaDescription {
		public AreaDescription() {
			position = new CLonLat();
			name = "";
		}

		public String name; // 256
		public int axid;
		public CLonLat position;
	}

	public class HWFlatName {
		public HWFlatName() {
			hwName = "";
			flatName = "";
		}

		public String hwName;
		public String flatName;
	}

	public class NavSetting {
		public int hw; // 锟斤拷锟斤拷锟斤拷锟斤拷
		public int gd; // 锟斤拷锟斤拷锟斤拷锟?
		public int pm; // 平锟斤拷锟斤拷锟斤拷
		public boolean drawRoute; // 路锟斤拷锟斤拷示
		public boolean drawRouteTMC; // 路锟斤拷TMC锟斤拷示
		public boolean alertOverSpeed; // 锟斤拷锟劫撅拷锟斤拷
		public boolean recal; // 锟斤拷锟斤拷锟斤拷锟斤拷
		public boolean novice; // 锟斤拷锟街碉拷锟斤拷
	}

	// 锟斤拷始锟斤拷锟斤拷锟斤拷锟?
	public native int Create(String rundir);

	public native void SetMapSize(int hGIS, int width, int height);

	public native void SetCrMapSize(int hGIS, int width, int height);

	public native void Destroy(int hGIS);

	public native void SetLanguage(int hGIS, int language);

	public native int GetLanguage(int hGIS);

	public native void SetCoutryId(int hGIS, String countryId);

	// 锟斤拷锟斤拷
	public native void SetMapViewMode(int hGIS, int viewMode);

	public native void Draw(int hGIS, byte[] bmp);

	public native boolean DrawCr(int hGIS, byte[] bmp);

	public native boolean DrawPoint(int hGIS, boolean isDraw);

	public native boolean DrawArea(int hGIS, boolean isDraw);

	public native boolean DrawAda(int hGIS, boolean isDraw);

	// 平锟狡★拷锟斤拷锟脚★拷锟斤拷锟斤拷锟斤拷锟侥点及锟斤拷锟阶拷锟?
	public native void Rotate(int hGIS, double degree);

	public native void SetDayNight(int hGIS, boolean isDay);

	public native void ZoomIn(int hGIS);

	public native void ZoomOut(int hGIS);

	// 锟斤拷锟斤拷双锟斤拷锟斤拷图
	public native void RotateSecondMap(int hGIS, double degree);

	public native void SetSecondMapDayNight(int hGIS, boolean isDay);

	public native void SetSecondMapstyle(int hGIS, int styleIndex);

	public native void ZoomInSecondMap(int hGIS);

	public native void ZoomOutSecondMap(int hGIS);

	public native void SetSecondMapScale(int hGIS, double scale);

	public native void SetSecondMapCenter(int hGIS, CLonLat ll);

	public native void SetSecondMapSize(int hGIS, int width, int height);

	public native void DrawSecondMap(int hGIS, byte[] bmp);

	public native double GetSecondMapScale(int hGIS);

	public native boolean SetSecondMapPosition(int hGIS, CPoint xy, CLonLat ll);

	public native int GetSecondMapScaleInMeter(int hGIS);

	public native double GetScale(int hGIS);

	public native void SetScale(int hGIS, double scale);

	public native int GetScaleInMeter(int hGIS);

	public native void GetMapViewExtent(int hGIS, CLonLat ld, CLonLat ru);

	public native void SetMapCenter(int hGIS, CLonLat pt); // 锟斤拷锟矫碉拷图锟斤拷锟侥碉拷

	public native void GetMapCenter(int hGIS, CLonLat pt);

	public native void MoveMap(int hGIS, int dx, int dy); // 指锟斤拷锟斤拷幕锟斤拷锟截碉拷平锟狡碉拷图

	public native boolean SetMapPosition(int hGIS, CPoint DevPt, CLonLat pt);

	public native void XY2LL(int hGIS, CPoint xy, CLonLat ll); // 锟斤拷锟斤拷幕锟斤拷锟阶拷锟轿拷锟酵硷拷锟斤拷

	public native void LL2XY(int hGIS, CLonLat ll, CPoint xy, int mapindex); // 锟斤拷锟斤拷图锟斤拷锟阶拷锟轿拷锟侥伙拷锟斤拷

	public native void CrLL2XY(int hGIS, CLonLat ll, CPoint xy);

	public native double GetDistance(int hGIS, CLonLat pt1, CLonLat pt2);

	public native boolean RescaleAndTranslateToFit(int hGIS, double MinLon,
			double MinLat, double MaxLon, double MaxLat);

	public native void SetMapstyle(int hGIS, int styleIndex);

	// route
	public native int BlockAtDistance(int hGIS, double distance);

	public native boolean SetRouteOption(int hGIS, RouteOption routeOption);

	public native int Route(int hGIS, NavStart pNavStart, NavDest destArray[],
			RouteErrorInfo pErrInfo);

	public native int Reroute(int hGIS, boolean isChooseHW);

	public native int GetCurrentPathIndex(int hGIS);

	public native void ClearRoute(int hGIS);

	public native int GetRoutingProcess(int hGIS);

	public native void RouteForMulti(int hGIS, NavStart pNavStart,
			NavDest destArray[], RouteOption routeoptions[], int curroindex,
			RouteErrorInfo pErrInfo[]);

	public native void SetRouteDrawMode(int hGIS, int mode);

	public native void ClearMultiRoute(int hGIS);

	public native boolean GetCurPathLengthInfo(int hGIS,
			PathLengthInfo lengthInfo, boolean frombegin);

	public native boolean GetMultiPathLengthInfo(int hGIS, int index,
			PathLengthInfo lengthInfo);

	public native boolean SelectMultiPath(int hGIS, int index,
			boolean copytocurpath, boolean clearcurpath);

	public native int PrepareCurTurnAndGuid(int hGIS);

	public native CLonLat[] GetRouteAllPts(int hGIS);

	public native void InitPathSimu(int hGIS);

	public native boolean GetNextSimuData(int hGIS, NavPosition pnavpos,
			int simuStep);

	public native boolean IsEdgeBlocked(int hGIS, CLonLat pt, int eid);

	public native boolean AddBlockEdge(int hGIS, CLonLat pt, int eid);

	public native boolean RemoveBlockEdge(int hGIS, CLonLat pt, int eid);

	public native void ClearBlockEdge(int hGIS);

	// Nav
	public native SDCurPosStates UpdatePosition(int hGIS, NavPosition pPos,
			NavPosition pMatchedPos, NavInfo pNavInfo);

	public native boolean PrepareTurnAndGuid(int hGIS);

	public native boolean NextTurnAndGuid(int hGIS, TurnInfo pTurnInfo,
			GuideInfo pGuidInfo, CLonLat pPos);

	public native void FinishTurnAndGuid(int hGIS);

	// 只锟斤拷锟饺★拷锟角奥凤拷锟斤拷系锟絫urn锟姐，锟斤拷锟斤拷路锟斤拷锟斤拷使锟斤拷GetPathTurnPts
	public native CLonLat[] GetAllTurnPts(int hGIS);

	// fromStart: true,锟接碉拷一锟斤拷path锟斤拷始统锟斤拷.false 锟接碉拷前path锟斤拷始统锟斤拷 一直取锟斤拷锟斤拷锟?
	public native CLonLat[] GetPathTurnPts(int hGIS, boolean fromStart);

	public native void SetNavSetting(int hGIS, NavSetting navSetting);

	// query
	// ada query
	public native long GetRootAda(int hGIS); // 锟斤拷锟饺拷锟斤拷锟斤拷锟斤拷锟斤拷锟絀D

	public native int PrepareChildAda(int hGIS, long parentAdaID); // 准锟斤拷枚锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷枚锟劫撅拷锟?

	public native boolean GetNextChildAda(int hGIS, int hAda, long childAda,
			AreaDescription adaName, CLonLat center); // 锟斤拷取锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟絀D锟斤拷锟斤拷疲锟斤拷锟斤拷牡恪ｏ拷锟斤拷锟紽ALSE锟斤拷锟斤拷丫锟矫讹拷锟斤拷辍?

	public native void FinishGetNextChildAda(int hGIS, int hAda); // 锟斤拷锟斤拷枚锟劫ｏ拷锟斤拷锟矫讹拷倬锟斤拷

	public native boolean GetLLAda(int hGIS, CLonLat ll, long adaID,
			AreaDescription adaName); // 锟斤拷锟侥筹拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟絀D锟斤拷锟斤拷锟斤拷锟斤拷锟?

	public native boolean IsLLInAda(int hGIS, CLonLat ll, long adaID); // 锟叫讹拷某一锟斤拷锟角凤拷锟斤拷指锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷

	public native void SetLodcfg(int hGIS, String lodcfg);

	// POI锟斤拷询
	// 准锟斤拷锟斤拷锟斤拷指锟斤拷锟姐附锟斤拷锟絇OI
	// pt[in] --- 锟斤拷要锟斤拷锟揭碉拷锟斤拷锟侥碉拷
	// poiType[in] --- 要锟斤拷锟揭碉拷POI锟斤拷锟酵ｏ拷应锟斤拷锟斤拷锟斤拷锟侥硷拷[Geocode]锟街讹拷锟斤拷取锟斤拷
	public native boolean PreparePOIByPoint(int hGIS, CLonLat pt,
			String poiType, String name, double searchRange);

	// 准锟斤拷锟斤拷锟揭撅拷锟轿凤拷围锟节碉拷POI
	public native boolean PreparePOIByRect(int hGIS, CLonLat bottomLeft,
			CLonLat topRight, String poiType);

	// 准锟斤拷锟斤拷指锟斤拷锟斤拷锟斤拷锟斤拷锟节革拷锟斤拷锟狡诧拷锟斤拷POI
	public native boolean PreparePOIByName(int hGIS, String name, long adaID,
			String poiType);

	// 锟斤拷锟斤拷锟揭伙拷锟絇OI锟斤拷锟斤拷锟斤拷FALSE锟斤拷锟斤拷丫锟矫讹拷锟斤拷辍?
	public native boolean GetNextPOI(int hGIS, POIDescription poiDesription);

	// 锟斤拷锟斤拷锟斤拷锟絇OI
	public native void FinishGetPOI(int hGIS);

	// / 锟斤拷路锟斤拷询
	public native boolean PrepareRoadByPoint(int hGIS, CLonLat pt,
			double searchRange/* 锟斤拷 */);

	public native boolean PrepareRoadByName(int hGIS, String name, long adaID);

	public native boolean GetNextRoad(int hGIS, RoadDescription roadDesription);

	public native void FinishGetRoad(int hGIS);

	// 锟斤拷锟窖?
	public native boolean GetAreaByPoint(int hGIS, CLonLat pt,
			AreaDescription areaDesription); // Maxlen=256

	// SmartQuery
	public native int SQCreate(String mapdir);

	public native void SQDestroy(int hSQ);

	public class KeypadResult {
		public int padsize;
		public int result_cnt;
	}

	public native String SQGetKeypadPOI(int hSQ, KeypadResult result);

	public native String SQGetKeypadCity(int hSQ, KeypadResult result);

	public native boolean SQStartQueryCity(int hSQ, String keyword,
			int ownerAdaID, int type);

	public native boolean SQGetResultCity(int hSQ, int nIndex,
			AreaDescription area);

	public native boolean SQStartQueryPOIHanzi(int hSQ, String keyword,
			int owner, int type);

	public native boolean SQStartQueryPOI(int hSQ, String keyword, int owner,
			int type);

	public native boolean SQGetResultPOI(int hSQ, POIDescription poiDesription,
			int nIndex);

	// 锟斤拷锟斤拷锟斤拷, GPS锟斤拷锟斤拷
	public static native void DecodeLonLat(CLonLat ll);

	public static native boolean IsRightUser(String id, String key);

	public static native boolean IsEncryptedMap(String mapfile);

	// get image handle
	public native int GetImageHandle(int hGIS);

	// get city adaid, for RTS TMC, 锟截硷拷锟斤拷ID or 直辖锟斤拷ID
	public native long GetCityAdaID(int hGIS, double lon, double lat);

	public native void GetUnitDegree(int hGIS, double lon, double lat,
			CllDegreePreMeter degree);

	public native void GetUnitLength(int hGIS, double lon, double lat,
			CLenPreLonlat lenpre);

	//PLSTYLE_SOLID = 0, PLSTYLE_DASH, PLSTYLE_PATH
	public native void AddPoly(int hGIS, CLonLat llArray[], int nStyle, int color, int nWidth, int type);
	public native void ClearPoly(int hGIS);

}
